package Teacher_Test.JDBC_test.view;

import Teacher_Test.JDBC_test.controller.UserController;
import org.junit.Test;

import java.util.Scanner;

public class UserView {
    public static void main(String[] args) {
        System.out.println("输入1：删除数据");
        Scanner scanner= new Scanner(System.in);
        int num= scanner.nextInt();
        if (num==1){
            deleteById(num);
        }
    }
    public static void deleteById(int id){
        System.out.println("输入删除的id：");
        Scanner scanner= new Scanner(System.in);
        int num = scanner.nextInt();
        UserController userController= new UserController();
        boolean bl= userController.deleteById(num);
        if (bl){
            System.out.println("删除成功");
        }else {
            System.out.println("删除失败");
        }
    }
}
